var echartsTheme = 'macarons';

var myQygm = {
        ids: {
            idnzTable: "table_zg",
            idfpTable: "table_fp",
            idxgzc: "table_xgzcwj"
        },
        charts: {
            yxswxsChart: null,
            jmztqkChart: null,
            zycszbChart: null,
            srgcChart: null
        },
        tabes: {
            nzTable: null,
            xgzcTable: null,
            fpTable: null
        },
        search: function () {
            $("#form_search").on('submit', function (e) {
                if ($("#sd1").val() == "") {
                    layer.alert("请填写社会信用代码");
                    return false;
                }
                var lay = layer.load({shade: [0.1]});
                $.ajax({
                    url: ctx + "/mge/adx/syfx/qyhx/getQyxx",
                    data: $("#form_search").formSerialize(),
                    type: 'post',
                    dataType: 'json',
                    success: function (data, sta) {
                        layer.close(lay);
                        if (data != null && data.code == '200') {
                            var dc = data.data;
                            if (dc != null) {
                                for (var d in dc) {
                                    var vd = $("#d_" + d);
                                    if (vd.length > 0) {
                                        $("#d_" + d).html(dc[d]);
                                    }
                                }
                                $("#djxh").val(dc.djxh);
                                myQygm.rdFbxxTable();
                                myQygm.rdZgTable();
                                var at = $("#qygl .active a");
                                tabDataShow(at);
                            } else {
                                layer.alert("没有查到该户信息！");
                            }
                        } else {
                            layer.alert(data.message);
                        }
                    }, error: function (sta) {
                        layer.close(lay);
                        layer.alert("请求失败，请重试或检查网络！");
                    }
                })
                return false;
            });
        },
        rdFbxxTable: function () {
            if (myQygm.tabes.fpTable) {
                myQygm.tabes.fpTable.refresh(myQygm.queryParams());
            }
            else {
                var bs = new BgdataTable();
                var opt = new BgOption(myQygm.ids.idfpTable, ctx + "/mge/adx/syfx/qyhx/queryRdxxFppzhd?rad=" + new Date().getTime(), [[
                    {
                        title: '发票种类', field: 'fpzlmc', width: "100px", align: 'center', valign: 'middle'
                    }, {
                        title: '最高开票限额', field: 'dffpzgkpxe', width: "200px", align: 'center', valign: 'middle', formatter: function (v) {
                            return v;
                        }
                    }, {
                        title: '持票最高数量', field: 'cpzgsl', width: "200px", align: 'center', valign: 'middle', formatter: function (v) {
                            return v;
                        }
                    }, {
                        title: '每月购票最高数量', field: 'myzggpsl', width: "200px", align: 'center', valign: 'middle', formatter: function (v) {
                            return v;
                        }
                    }
                ]], myQygm.queryParams(), null);
                opt.toolbarId = null;
                opt.showColumns = false;
                opt.showRefresh = false;
                opt.onLoadSuccess = function (data) {
                    $(".pagination-detail").hide();
                }
                bs.draw(opt);
                myQygm.tabes.fpTable = bs;
            }
        },
        rdZgTable: function () {
            if (myQygm.tabes.nzTable) {
                myQygm.tabes.nzTable.refresh(myQygm.queryParams());
            } else {
                var bs = new BgdataTable();
                var opt = new BgOption(myQygm.ids.idnzTable, ctx + "/mge/adx/syfx/qyhx/queryRdxxNsrlx?rad=" + new Date().getTime(), [[
                    {
                        title: '纳税人资格类型', field: 'nsrzglx', width: "100px", align: 'center', valign: 'middle'
                    }, {
                        title: '认定日期', field: 'lrrq', width: "200px", align: 'center', valign: 'middle', formatter: function (v) {
                            return v;
                        }
                    }, {
                        title: '认定有效期起', field: 'yxqq', width: "200px", align: 'center', valign: 'middle', formatter: function (v) {
                            return v;
                        }
                    }, {
                        title: '认定有效期止', field: 'yxqz', width: "200px", align: 'center', valign: 'middle', formatter: function (v) {
                            return v;
                        }
                    }
                ]], myQygm.queryParams(), null);
                opt.showColumns = false;
                opt.showRefresh = false;
                opt.onLoadSuccess = function (data) {
                    $(".pagination-detail").hide();
                }
                opt.toolbarId = null;
                bs.draw(opt);
                myQygm.tabes.nzTable = bs;
            }
        },
        clearAll: function () {
            myQygm.charts.yxswxsChart.clear();
            if (myQygm.charts.yxswxsChart.isDisposed()) {
                myQygm.charts.yxswxsChart.dispose();
            }
            myQygm.charts.jmztqkChart.clear();
            if (myQygm.charts.jmztqkChart.isDisposed()) {
                myQygm.charts.jmztqkChart.dispose();
            }
            $('#eh_yxswxs').html("");
            $('#eh_jmztqk').html("");
        },
        yxswxsEchart: function () {
            if (myQygm.charts.yxswxsChart) {
                return;
            }
            if ($("#djxh").val() == '') {
                return;
            }
            $.ajax({
                url: ctx + "/mge/adx/syfx/qyhx/queryTxwxqk",
                data: $("#from_rd").formSerialize(),
                type: 'post',
                dataType: 'json',
                success: function (d, sta) {
                    if (d != null && d.code == "200") {
                        var data = d.data;
                        var colorTemplate1 = [[1, '#00a2e8']];
                        if (data == null || data.length == 0) {
                            $("#yxl_bq_je").html("");
                            $("#yxl_yts_je").html("");
                            return;
                        }
                        $("#yxl_bq_je").html(data[0].rkse);
                        $("#yxl_yts_je").html(data[0].ybtse);
                        var echartsTheme = 'macarons';
                        myQygm.charts.yxswxsChart = echarts.init($('#eh_yxswxs')[0], {
                            renderer: "canvas",
                            width: 100,
                            height: 200
                        });
                        var option = ybtOption(toFixed(data[0].ytzrkbl, 100), '应退站入库比');
                        myQygm.charts.yxswxsChart.setOption(option);
                    } else {
                        $('#eh_yxswxs').html("生成失败！");
                    }
                }, error: function (sta) {
                    $('#eh_yxswxs').html("生成失败！");
                }
            });
        }, jmztqkEchart: function () {
            if (myQygm.charts.jmztqkChart) {
                return;
            }
            if ($("#djxh").val() == '') {
                return;
            }
            $.ajax({
                url: ctx + "/mge/adx/syfx/qyhx/queryJmztqk",
                data: $("#from_rd").formSerialize(),
                type: 'post',
                dataType: 'json',
                success: function (d, sta) {
                    if (d != null && d.code == "200") {
                        var data = d.data;

                        if (data == null || data.length == 0) {
                            $("#yxl_mz_je").html("");
                            $("#yxl_jm_je").html("");
                            return;
                        }
                        $("#yxl_mz_je").html(data[0].bqjmse);
                        $("#yxl_jm_je").html(data[0].ljjmse);
                        myQygm.charts.jmztqkChart = echarts.init($('#eh_jmztqk')[0], {
                            renderer: "canvas",
                            width: 100,
                            height: 200
                        });
                        var option = ybtOption(toFixed(data[0].jmzrkbl, 100), '减免占应征比');
                        myQygm.charts.jmztqkChart.setOption(option);
                    }
                    else {
                        $('#eh_jmztqk').html("生成失败！");
                    }
                }, error: function (sta) {
                    $('#eh_jmztqk').html("生成失败！");
                }
            });
        }, xgzcwjTable: function () {
            if ($("#djxh").val() == '') {
                return;
            }
            if (myQygm.tabes.xgzcTable) {
                myQygm.tabes.xgzcTable.refresh(myQygm.queryParams());
            } else {
                var bs = new BgdataTable();
                var opt = new BgOption(myQygm.ids.idxgzc, ctx + "/mge/adx/syfx/qyhx/queryXgzcwj?rad=" + new Date().getTime(), [[
                    {
                        title: '文号', field: 'wh', width: "100px", align: 'center', valign: 'middle'
                    }, {
                        title: '税收减免文件名称', field: 'ssjmwjmc', width: "200px", align: 'center', valign: 'middle', formatter: function (v) {
                            return v;
                        }
                    }, {
                        title: '发文单位', field: 'fwdw', width: "200px", align: 'center', valign: 'middle', formatter: function (v) {
                            return v;
                        }
                    }
                ]], myQygm.queryParams(), null);
                opt.showColumns = false;
                opt.showRefresh = false;
                opt.paginationType = "client";
                opt.onLoadSuccess = function (data) {
                    $(".pagination-detail").hide();
                }
                opt.toolbarId = null;
                bs.draw(opt);
                myQygm.tabes.xgzcTable = bs;
            }
        }, zycszbEchart: function () {
            if ($("#djxh").val() == '') {
                return;
            }
            var lay = layer.load({shade: [0.1]});
            $.ajax({
                url: ctx + "/mge/adx/syfx/qyhx/queryZycszb",
                data: $("#from_rd").formSerialize(),
                type: 'post',
                dataType: 'json',
                success: function (data, sta) {
                    layer.close(lay);
                    if (data.code == "200" && data.data.length > 0) {
                        var myChart = echarts.init(document.getElementById('eh_zycszb'), {
                            renderer: "canvas"
                        });
                        myQygm.charts.zycszbChart = myChart;
                        var bq = [];
                        var tq = [];
                        if (data.data[0].bz == '0') {
                            var bqz = data.data[0];
                            bq.push(cmm.isNUllZro(bqz.zczb));
                            bq.push(cmm.isNUllZro(bqz.xse));
                            bq.push(cmm.isNUllZro(bqz.lrze));
                            bq.push(cmm.isNUllZro(bqz.nsje));
                            bq.push(cmm.isNUllZro(bqz.qsje));
                            bq.push(cmm.isNUllZro(bqz.jmse));
                            if (data.data.length > 1) {
                                var tqz = data.data[1];
                                tq.push(cmm.isNUllZro(tqz.zczb));
                                tq.push(cmm.isNUllZro(tqz.xse));
                                tq.push(cmm.isNUllZro(tqz.lrze));
                                tq.push(cmm.isNUllZro(tqz.nsje));
                                tq.push(cmm.isNUllZro(tqz.qsje));
                                tq.push(cmm.isNUllZro(tqz.jmse));
                            }

                        } else {
                            var tqz = data.data[0];
                            tq.push(cmm.isNUllZro(tqz.zczb));
                            tq.push(cmm.isNUllZro(tqz.xse));
                            tq.push(cmm.isNUllZro(tqz.lrze));
                            tq.push(cmm.isNUllZro(tqz.nsje));
                            tq.push(cmm.isNUllZro(tqz.qsje));
                            tq.push(cmm.isNUllZro(tqz.jmse));
                            if (data.data.length > 1) {
                                var bqz = data.data[1];
                                bq.push(cmm.isNUllZro(bqz.zczb));
                                bq.push(cmm.isNUllZro(bqz.xse));
                                bq.push(cmm.isNUllZro(bqz.lrze));
                                bq.push(cmm.isNUllZro(bqz.nsje));
                                bq.push(cmm.isNUllZro(bqz.qsje));
                                bq.push(cmm.isNUllZro(bqz.jmse));
                            }
                        }
                        myChart.setOption(zycszbOption(bq, tq));
                    } else {

                    }
                }, error: function (sta) {
                    layer.close(lay);

                }
            });

        }, srgcEchart: function () {
            if ($("#djxh").val() == '') {
                return;
            }
            $.ajax({
                url: ctx + "/mge/adx/syfx/qyhx/querySsgc", data: $("#from_rd").formSerialize(), type: 'post', dataType: "json", success: function (data, sta) {
                    if (data != null && data.code == "200") {
                        if (data.data.length > 0) {
                            var myChart = echarts.init(document.getElementById('eh_srgc'), {
                                renderer: "canvas"
                            });
                            myQygm.charts.srgcChart = myChart;
                            myQygm.charts.srgcChart.setOption(srgcOption(data.data[0]));
                        } else {
                        }
                    }
                }, error: function (stat) {

                }
            });
        }, cwzk_yynlEchart: function () {
            if ($("#djxh").val() == '') {
                return;
            }
            $.ajax({
                url: ctx + "/mge/adx/syfx/qyhx/queryYynl", data: $("#from_rd").formSerialize(), type: 'post', dataType: "json", success: function (data, sta) {
                    if (data != null && data.code == "200") {
                        if (data.data.length > 0) {
                            var yszk = $("#eh_yynl_yszk");
                            if (cmm.isNotNull(data.data[0].yszkzzl)) {
                                yszk.parent().show();
                                myQygm.charts["yynlYszkEchart"] = echarts.init(yszk[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["yynlYszkEchart"].setOption(ybtOption(toFixed(data.data[0].yszkzzl, 100), "应收账款周转率"));
                            } else {
                                yszk.parent().hide();
                            }
                            var ch = $("#eh_yynl_ch");
                            if (cmm.isNotNull(data.data[0].chzzl)) {
                                ch.parent().show();
                                myQygm.charts["yynlchEchart"] = echarts.init(ch[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["yynlchEchart"].setOption(ybtOption(toFixed(data.data[0].chzzl, 100), "存货周转率"));
                            } else {
                                ch.parent().hide();
                            }
                            var gdzc = $("#eh_yynl_gdzc");
                            if (cmm.isNotNull(data.data[0].gdzczzl)) {
                                gdzc.parent().show();
                                myQygm.charts["yynlgdzcEchart"] = echarts.init(gdzc[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["yynlgdzcEchart"].setOption(ybtOption(toFixed(data.data[0].gdzczzl, 100), "存货周转率"));
                            } else {
                                gdzc.parent().hide();
                            }
                        } else {
                        }
                    }
                }, error: function (stat) {

                }
            });
        }, cwzk_ylnlEchart: function () {
            if ($("#djxh").val() == '') {
                return;
            }
            $.ajax({
                url: ctx + "/mge/adx/syfx/qyhx/queryYlnl", data: $("#from_rd").formSerialize(), type: 'post', dataType: "json", success: function (data, sta) {
                    if (data != null && data.code == "200") {
                        if (data.data.length > 0) {
                            var yszk = $("#eh_ylnl_ml");
                            if (cmm.isNotNull(data.data[0].mll)) {
                                yszk.parent().show();
                                myQygm.charts["yynlmlEchart"] = echarts.init(yszk[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["yynlmlEchart"].setOption(ybtOption(toFixed(data.data[0].mll, 100), "毛利率"));
                            } else {
                                yszk.parent().hide();
                            }
                            var yylr = $("#eh_ylnl_yylr");
                            if (cmm.isNotNull(data.data[0].yylrl)) {
                                yylr.parent().show();
                                myQygm.charts["yynlyylrEchart"] = echarts.init(yylr[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["yynlyylrEchart"].setOption(ybtOption(toFixed(data.data[0].yylrl, 100), "营业利润率"));
                            } else {
                                yylr.parent().hide();
                            }

                        } else {
                        }
                    }
                }, error: function (stat) {

                }
            });
        }, cwzk_cznlEchart: function () {
            if ($("#djxh").val() == '') {
                return;
            }
            $.ajax({
                url: ctx + "/mge/adx/syfx/qyhx/queryCznl", data: $("#from_rd").formSerialize(), type: 'post', dataType: "json", success: function (data, sta) {
                    if (data != null && data.code == "200") {
                        if (data.data.length > 0) {
                            var yszk = $("#eh_cznl_ldbl");
                            if (cmm.isNotNull(data.data[0].ldbl)) {
                                yszk.parent().show();
                                myQygm.charts["cznlldblEchart"] = echarts.init(yszk[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["cznlldblEchart"].setOption(ybtOption(toFixed(data.data[0].ldbl, 100), "流动比率"));
                            } else {
                                yszk.parent().hide();
                            }
                            var yylr = $("#eh_cznl_sdbl");
                            if (cmm.isNotNull(data.data[0].sdbl)) {
                                yylr.parent().show();
                                myQygm.charts["cznlsdblEchart"] = echarts.init(yylr[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["cznlsdblEchart"].setOption(ybtOption(toFixed(data.data[0].sdbl, 100), "速动比率"));
                            } else {
                                yylr.parent().hide();
                            }
                            var zcfzl = $("#eh_cznl_zcfzl");
                            if (cmm.isNotNull(data.data[0].zcfzl)) {
                                zcfzl.parent().show();
                                myQygm.charts["cznlzcfzlEchart"] = echarts.init(zcfzl[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["cznlzcfzlEchart"].setOption(ybtOption(toFixed(data.data[0].zcfzl, 100), "资产负债率"));
                            } else {
                                zcfzl.parent().hide();
                            }
                        } else {
                        }
                    }
                }, error: function (stat) {

                }
            });
        }, cwzk_ylzlEchart: function () {
            if ($("#djxh").val() == '') {
                return;
            }
            $.ajax({
                url: ctx + "/mge/adx/syfx/qyhx/queryYlzl", data: $("#from_rd").formSerialize(), type: 'post', dataType: "json", success: function (data, sta) {
                    if (data != null && data.code == "200") {
                        if (data.data.length > 0) {
                            var yszk = $("#eh_ylzl_yycbl");
                            if (cmm.isNotNull(data.data[0].yycbl)) {
                                yszk.parent().show();
                                myQygm.charts["ylzlyycblEchart"] = echarts.init(yszk[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["ylzlyycblEchart"].setOption(ybtOption(toFixed(data.data[0].yycbl, 100), "营业成本率"));
                            } else {
                                yszk.parent().hide();
                            }
                            var yylr = $("#eh_ylzl_cbfylyl");
                            if (cmm.isNotNull(data.data[0].cbfylyl)) {
                                yylr.parent().show();
                                myQygm.charts["ylzlcbfylylEchart"] = echarts.init(yylr[0], {
                                    renderer: "canvas"
                                });
                                myQygm.charts["ylzlcbfylylEchart"].setOption(ybtOption(toFixed(data.data[0].cbfylyl, 100), "营业利润率"));
                            } else {
                                yylr.parent().hide();
                            }

                        } else {
                        }
                    }
                }, error: function (stat) {

                }
            });
        }, sstz_zyzb: function (data) {
            if (data.length > 0) {
                var v = $("#eh_sstz_qsbhl");
                if (data[0].qsjebhl != null) {
                    v.parent().show();
                    if (myQygm.charts["sstzqsbhlEchart"]) {
                        myQygm.charts["sstzqsbhlEchart"].clear();
                        myQygm.charts["sstzqsbhlEchart"].setOption(ybtOption(toFixed(data[0].qsjebhl, 100), "欠税金额变化率"));
                    } else {
                        myQygm.charts["sstzqsbhlEchart"] = echarts.init(v[0], {
                            renderer: "canvas"
                        });
                        myQygm.charts["sstzqsbhlEchart"].setOption(ybtOption(toFixed(data[0].qsjebhl, 100), "欠税金额变化率"));
                    }
                } else {
                    v.parent().hide();
                }
                var p = $("#eh_sstz_cbsktz");
                if (data[0].cbskbl != null) {
                    p.parent().show();
                    if (myQygm.charts["sstzcbsktzEchart"]) {
                        myQygm.charts["sstzcbsktzEchart"].clear();
                        myQygm.charts["sstzcbsktzEchart"].setOption(ybtOption(toFixed(data[0].cbskbl, 100), "查补税款比重"));
                    } else {
                        myQygm.charts["sstzcbsktzEchart"] = echarts.init(p[0], {
                            renderer: "canvas"
                        });
                        myQygm.charts["sstzcbsktzEchart"].setOption(ybtOption(toFixed(data[0].cbskbl, 100), "查补税款比重"));
                    }
                } else {
                    p.parent().hide();
                }
            }
        }, sstz_jynqs: function (data) {
            if (data != null && data.length > 0) {
                var ny = [];
                var xssrs = [];
                var zzsjes = [];
                var kpjes = [];
                for (var f in data) {
                    ny.push(data[f].ny);
                    xssrs.push(data[f].xssr);
                    zzsjes.push(data[f].zzsje);
                    kpjes.push(data[f].kpje);
                }
                var v = $("#eh_sstz_jynjyzk");
                if (myQygm.charts["sstzjynjyzkEchart"]) {
                    myQygm.charts["sstzjynjyzkEchart"].clear();
                    myQygm.charts["sstzjynjyzkEchart"].setOption(lineOption(ny, xssrs, zzsjes, kpjes));
                } else {
                    myQygm.charts["sstzjynjyzkEchart"] = echarts.init(v[0], {
                        renderer: "canvas"
                    });
                    myQygm.charts["sstzjynjyzkEchart"].setOption(lineOption(ny, xssrs, zzsjes, kpjes));
                }
            }
        }, sstz_jynswxw: function (data) {
            $("#eh_sstz_jynswxw").html("");
            if (cmm.isNotNull(data) && data.length > 0) {
                var h = "";
                h += "<p>连续" + data[0].lxlse + "个月零税额申报次数</p>";
                h += "<p>连续" + data[0].lxlsl + "个月零适用税率征收申报次数</p>";
                h += "<p>逾期未申报次数" + data[0].yqwsb + "</p>";
                h += "<p>逾期未缴款次数" + data[0].yqwjk + "</p>";
                h += "<p>税收违法违章次数" + data[0].sswfwz + "</p>";
                $("#eh_sstz_jynswxw").html(h);
            }
        }, sstz_jcjbsr: function (data) {
            if (cmm.isNotNull(data) && data.length > 0) {
                var v = $("#eh_sstz_jccbsrjg");
                if (myQygm.charts["sstzjccbsrjgEchart"]) {
                    myQygm.charts["sstzjccbsrjgEchart"].clear();
                    myQygm.charts["sstzjccbsrjgEchart"].setOption(jcsrOption(data[0]));
                } else {
                    myQygm.charts["sstzjccbsrjgEchart"] = echarts.init(v[0], {
                        renderer: "canvas"
                    });
                    myQygm.charts["sstzjccbsrjgEchart"].setOption(jcsrOption(data[0]));
                }
            }
        }, fpxx_fpslhje: function (data) {
            if (cmm.isNotNull(data) && data.length > 0) {
                var v = $("#eh_fpxx_fpsltj");
                if (myQygm.charts["fpxxfpsltjEchart"]) {
                    myQygm.charts["fpxxfpsltjEchart"].clear();
                    myQygm.charts["fpxxfpsltjEchart"].setOption(fptjOption([
                        {value: (data[0].zpfsbl * 100), name: '专用发票'},
                        {value: (data[0].ppfsbl * 100), name: '普通发票'}
                    ]));
                } else {
                    myQygm.charts["fpxxfpsltjEchart"] = echarts.init(v[0], {
                        renderer: "canvas"
                    });
                    myQygm.charts["fpxxfpsltjEchart"].setOption(fptjOption([
                        {value: (data[0].zpfsbl * 100), name: '专用发票'},
                        {value: (data[0].ppfsbl * 100), name: '普通发票'}
                    ]));
                }
                var sl = " <p>开具发票数量：" + data[0].fpzfs + "份数</p>"
                    + "<p>增值税专用发票：" + data[0].zpfs + "份数</p>"
                    + "<p>增值税普通发票：" + data[0].ppfs + "份数</p>";
                $("#fpxxsltj").html(sl);

                var v = $("#eh_fpxx_fpjetj");
                if (myQygm.charts["fpxxfpjetjEchart"]) {
                    myQygm.charts["fpxxfpjetjEchart"].clear();
                    myQygm.charts["fpxxfpjetjEchart"].setOption(fptjOption([
                        {value: (data[0].zpfsbl * 100), name: '专用发票'},
                        {value: (data[0].ppfsbl * 100), name: '普通发票'}
                    ]));
                } else {
                    myQygm.charts["fpxxfpjetjEchart"] = echarts.init(v[0], {
                        renderer: "canvas"
                    });
                    myQygm.charts["fpxxfpjetjEchart"].setOption(fptjOption([
                        {value: (data[0].zpjebl * 100), name: '专用发票'},
                        {value: (data[0].ppjebl * 100), name: '普通发票'}
                    ]));
                }
                var je = " <p>开具发票金额：" + data[0].kpzje + "元</p>"
                    + "<p>增值税专用发票：" + data[0].zpje + "元</p>"
                    + "<p>增值税普通发票：" + data[0].ppje + "元</p>";
                $("#fpxxsltj").html(je);

            } else {
                var sl = " <p>开具发票数量：份数</p>"
                    + "<p>增值税专用发票：份数</p>"
                    + "<p>增值税普通发票：份数</p>";
                $("#fpxxsltj").html(sl);
            }
        }, fpxx_kpzyzb: function (data) {
            if (cmm.isNotNull(data) && data.length > 1) {
                var v = $("#eh_fpxx_kpzyzb");
                var qybz = [];
                var hybz = [];
                if (data[0].bz == "0") {
                    qybz.push(data[0].wkpje);
                    qybz.push(data[0].yjkpje);
                    qybz.push(data[0].dekpje);
                    qybz.push(data[0].zffpje);
                    hybz.push(data[1].wkpje);
                    hybz.push(data[1].yjkpje);
                    hybz.push(data[1].dekpje);
                    hybz.push(data[1].zffpje);
                } else {
                    qybz.push(data[1].wkpje);
                    qybz.push(data[1].yjkpje);
                    qybz.push(data[1].dekpje);
                    qybz.push(data[1].zffpje);
                    hybz.push(data[0].wkpje);
                    hybz.push(data[0].yjkpje);
                    hybz.push(data[0].dekpje);
                    hybz.push(data[0].zffpje);
                }
                if (myQygm.charts["fpxxkpzyzbEchart"]) {
                    myQygm.charts["fpxxkpzyzbEchart"].clear();
                    myQygm.charts["fpxxkpzyzbEchart"].setOption(kpzyzbOption(qybz, hybz));
                } else {
                    myQygm.charts["fpxxkpzyzbEchart"] = echarts.init(v[0], {
                        renderer: "canvas"
                    });
                    myQygm.charts["fpxxkpzyzbEchart"].setOption(kpzyzbOption(qybz, hybz));
                }
            }
        }, fpxx_xshjx: function (xsdata, jxdata) {
            if (cmm.isNotNull(xsdata) && xsdata.length > 0) {
                var v = $("#eh_fpxx_xshw10");
                var ax = [];
                var dx = [];
                for (var d in xsdata) {
                    ax.push(xsdata[d].hwmc);
                    dx.push(xsdata[d].je);
                }
                if (myQygm.charts["fpxxxshw10Echart"]) {
                    myQygm.charts["fpxxxshw10Echart"].clear();
                    myQygm.charts["fpxxxshw10Echart"].setOption(xshjxOption(ax, dx));
                } else {
                    myQygm.charts["fpxxxshw10Echart"] = echarts.init(v[0], {
                        renderer: "canvas"
                    });
                    myQygm.charts["fpxxxshw10Echart"].setOption(xshjxOption(ax, dx));
                }
            }
            if (cmm.isNotNull(jxdata) && jxdata.length > 0) {
                var f = $("#eh_fpxx_jxhw10");
                var ax2 = [];
                var dx2 = [];
                for (var d in jxdata) {
                    ax2.push(jxdata[d].hwmc);
                    dx2.push(jxdata[d].je);
                }
                if (myQygm.charts["fpxxjxhw10Echart"]) {
                    myQygm.charts["fpxxjxhw10Echart"].clear();
                    myQygm.charts["fpxxjxhw10Echart"].setOption(xshjxOption(ax2, dx2));
                } else {
                    myQygm.charts["fpxxjxhw10Echart"] = echarts.init(f[0], {
                        renderer: "canvas"
                    });
                    myQygm.charts["fpxxjxhw10Echart"].setOption(xshjxOption(ax2, dx2));
                }
            }
        }, fpxx_xsghfx: function (xsdata, ghdata) {
            if (cmm.isNotNull(xsdata) && xsdata.length > 0) {
                var v = $("#eh_fpxx_xsdqfx");
                var dd = [];
                for (var d in xsdata) {
                    dd.push({value: xsdata[d].je, name: xsdata[d].sfmc});
                }
                if (myQygm.charts["fpxxxsdqfxEchart"]) {
                    myQygm.charts["fpxxxsdqfxEchart"].clear();
                    myQygm.charts["fpxxxsdqfxEchart"].setOption(xhghfxOption(dd));
                } else {
                    myQygm.charts["fpxxxsdqfxEchart"] = echarts.init(v[0], {
                        renderer: "canvas"
                    });
                    myQygm.charts["fpxxxsdqfxEchart"].setOption(xhghfxOption(dd));
                }
            }
            if (cmm.isNotNull(ghdata) && ghdata.length > 0) {
                var f = $("#eh_fpxx_ghdqfx");
                var pp = [];
                for (var d in ghdata) {
                    pp.push({value: ghdata[d].je, name: ghdata[d].sfmc});
                }
                if (myQygm.charts["fpxxghdqfxEchart"]) {
                    myQygm.charts["fpxxghdqfxEchart"].clear();
                    myQygm.charts["fpxxghdqfxEchart"].setOption(xhghfxOption(pp));
                } else {
                    myQygm.charts["fpxxghdqfxEchart"] = echarts.init(f[0], {
                        renderer: "canvas"
                    });
                    myQygm.charts["fpxxghdqfxEchart"].setOption(xhghfxOption(pp));
                }
            }
        }, cwzk: function () {//财务状况
            if ($("#djxh").val() != "") {
                var lay = layer.load({shade: [0.1]});
                $.ajax({
                    url: ctx + "/mge/adx/syfx/qyhx/queryCwzk",
                    data: $("#from_rd").formSerialize(),
                    type: "post", dataType: "json", success: function (data, sta) {
                        if (data != null && data.code == '200') {
                            myQygm.zycszbEchart();
                            myQygm.srgcEchart();
                            myQygm.cwzk_yynlEchart();
                            myQygm.cwzk_ylnlEchart();
                            myQygm.cwzk_cznlEchart();
                            myQygm.cwzk_ylzlEchart();
                        }
                    }, error: function (sta) {

                    }
                })
            }

        },
        ssjm: function () {
            myQygm.yxswxsEchart();
            myQygm.jmztqkEchart();
            myQygm.xgzcwjTable();
        },
        sstz: function () {
            if ($("#djxh").val() != "") {
                var lay = layer.load({shade: [0.1]});
                $.ajax({
                    url: ctx + "/mge/adx/syfx/qyhx/querySstz",
                    data: $("#from_rd").formSerialize(),
                    type: 'post', dataType: 'json', success: function (data, sta) {
                        layer.close(lay);
                        if (data != null && data.code == "200") {
                            myQygm.sstz_jynqs(data.data.jynzk);
                            myQygm.sstz_zyzb(data.data.zyzb);
                            myQygm.sstz_jynswxw(data.data.jynswxw);
                            myQygm.sstz_jcjbsr(data.data.jcjbsr);
                        }
                    }, error: function (st) {
                        layer.close(lay);
                    }
                })

            }
        }, fpxx: function () {
            if ($("#djxh").val() != "") {
                var lay = layer.load({shade: [0.1]});
                $.ajax({
                    url: ctx + "/mge/adx/syfx/qyhx/queryFpxx",
                    data: $("#from_rd").formSerialize(),
                    type: 'post', dataType: 'json', success: function (data, sta) {
                        layer.close(lay);
                        if (data != null && data.code == "200") {
                            myQygm.fpxx_fpslhje(data.data.kjslhje);
                            myQygm.fpxx_kpzyzb(data.data.kpzyzb);
                            myQygm.fpxx_xsghfx(data.data.xhdqfx, data.data.ghdqfx);
                            myQygm.fpxx_xshjx(data.data.xshw, data.data.Jxhw);
                        }
                    }, error: function (st) {
                        layer.close(lay);
                    }
                })

            }
        }
        ,
        queryParams: function () {
            return cmm.serializeObject($("#from_rd"));
        }
        ,
        collapse: function () {
            $('body').on('click', '.portlet > .portlet-title > .tools > .collapse, .portlet .portlet-title > .tools > .expand', function (e) {
                e.preventDefault();
                var el = $(this).closest(".portlet").children(".portlet-body");
                if ($(this).hasClass("collapse")) {
                    $(this).removeClass("collapse").addClass("expand");
                    el.slideUp(200);
                } else {
                    $(this).removeClass("expand").addClass("collapse");
                    el.slideDown(200);
                }
            });
        }
        ,
        getViewPort: function () {
            var e = window,
                a = 'inner';
            if (!('innerWidth' in window)) {
                a = 'client';
                e = document.documentElement || document.body;
            }

            return {
                width: e[a + 'Width'],
                height: e[a + 'Height']
            };
        }
        ,
        resize: function () {

        }
        ,
        fullscreen: function () {
            // handle portlet fullscreen
            $('body').on('click', '.portlet > .portlet-title .fullscreen', function (e) {
                e.preventDefault();
                var portlet = $(this).closest(".portlet");
                if (portlet.hasClass('portlet-fullscreen')) {
                    $(this).removeClass('on');
                    portlet.removeClass('portlet-fullscreen');
                    $('body').removeClass('page-portlet-fullscreen');
                    portlet.children('.portlet-body').css('height', 'auto');
                } else {
                    var height = myQygm.getViewPort().height -
                        portlet.children('.portlet-title').outerHeight() -
                        parseInt(portlet.children('.portlet-body').css('padding-top')) -
                        parseInt(portlet.children('.portlet-body').css('padding-bottom'));

                    $(this).addClass('on');
                    portlet.addClass('portlet-fullscreen');
                    $('body').addClass('page-portlet-fullscreen');
                    portlet.children('.portlet-body').css('height', height);
                }
            });
        }
    }
    ;
$(function () {
    $('.portlet > .portlet-title .fullscreen').tooltip({
        container: 'body',
        title: '最大化'
    });
    $('.portlet > .portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand').tooltip({
        container: 'body',
        title: '展开/收缩'
    });
    $("#qygl a").on("click", function (e) {
        e.preventDefault();
        $(this).tab("show");
        tabDataShow($(this));
    });
    myQygm.collapse();
    myQygm.fullscreen();
    myQygm.search();
    qySunburst();
    $(window).resize(function () {
        for (var chars in myQygm.charts) {
            if (myQygm.charts[chars]) {
                myQygm.charts[chars].resize()
            }
        }
    })
});
function toFixed(v, f) {
    var l = v * f;
    return l.toFixed(2);
}
function tabDataShow(t) {
    if (t.attr("href") == "#portlet_ssjm") {
        myQygm.ssjm();
    } else if (t.attr("href") == "#portlet_cwzk") {
        myQygm.cwzk();
    } else if (t.attr("href") == "#portlet_sstz") {
        myQygm.sstz();
    } else if (t.attr("href") == "#portlet_fpgl") {
        myQygm.fpxx();
    }
}
function qySunburst() {

    var data1 = [{
        name: '工商',
        itemStyle: {
            color: '#da0d68'
        },
        children: [{
            name: '企业信息',
            value: 1,
            itemStyle: {
                color: '#975e6d'
            }
        }, {
            name: '变更登记',
            itemStyle: {
                color: '#e0719c'
            },
            children: [{
                name: '变更前：张三；变更后：李四',
                value: 1,
                itemStyle: {
                    color: '#f99e1c'
                }
            }, {
                name: '变更前：李四；变更后：王五',
                value: 1,
                itemStyle: {
                    color: '#ef5a78'
                }
            }, {
                name: '变更前：王五；变更后：马六',
                value: 1,
                itemStyle: {
                    color: '#f7f1bd'
                }
            }]
        }]
    }, {
        name: '环保',
        itemStyle: {
            color: '#da1d23'
        },
        children: [{
            name: '监督性监测',
            itemStyle: {
                color: '#dd4c51'
            },
            children: [{
                name: '1月，氮氧化物，27829',
                value: 1,
                itemStyle: {
                    color: '#3e0317'
                }
            }, {
                name: '2月，氮氧化物，27500',
                value: 1,
                itemStyle: {
                    color: '#e62969'
                }
            }, {
                name: '3月，氮氧化物，30000',
                value: 1,
                itemStyle: {
                    color: '#6569b0'
                }
            }, {
                name: '4月，氮氧化物，30100',
                value: 1,
                itemStyle: {
                    color: '#ef2d36'
                }
            }]
        }, {
            name: '自动监测',
            itemStyle: {
                color: '#c94a44'
            },
            children: [{
                name: '1月，氮氧化物，1000',
                value: 1,
                itemStyle: {
                    color: '#b53b54'
                }
            }, {
                name: '2月，氮氧化物，800',
                value: 1,
                itemStyle: {
                    color: '#a5446f'
                }
            }]
        }, {
            name: '大气污染物排放口',
            itemStyle: {
                color: '#dd4c51'
            },
            children: [{
                name: 'DA001,118.279230,39.919830',
                value: 1,
                itemStyle: {
                    color: '#f2684b'
                }
            }, {
                name: 'DA002,118.479800,39.755460',
                value: 1,
                itemStyle: {
                    color: '#e73451'
                }
            }]
        }, {
            name: '水污染物排放口',
            itemStyle: {
                color: '#f7a128'
            },
            children: [{
                name: 'DW001,116.613700,38.065670',
                value: 1,
                itemStyle: {
                    color: '#f26355'
                }
            }, {
                name: 'DW002,116.619190,38.098570',
                value: 1,
                itemStyle: {
                    color: '#e2631e'
                }
            }, {
                name: 'DW003,116.612190,38.076570',
                value: 1,
                itemStyle: {
                    color: '#fde404'
                }
            }]
        }]
    }, {
        name: '许可',
        itemStyle: {
            color: '#ebb40f'
        },
        children: [{
            name: '许可',
            itemStyle: {
                color: '#e1c315'
            },
            children: [{
                name: '通知-（2019）第02批',
                value: 1,
                itemStyle: {
                    color: '#9ea718'
                }
            }, {
                name: '通知-（2019）第13批',
                value: 1,
                itemStyle: {
                    color: '#94a76f'
                }
            }, {
                name: '通知-（2019）第15批',
                value: 1,
                itemStyle: {
                    color: '#d0b24f'
                }
            }, {
                name: '通知-（2019）第12批',
                value: 1,
                itemStyle: {
                    color: '#8eb646'
                }
            }]
        }]
    }, {
        name: '商标',
        itemStyle: {
            color: '#187a2f'
        },
        children: [{
            name: '商标',
            itemStyle: {
                color: '#3aa255'
            },
            children: [{
                name: '三只羊',
                value: 1,
                itemStyle: {
                    color: '#a2bb2b'
                }
            }, {
                name: '民信贷',
                value: 1,
                itemStyle: {
                    color: '#62aa3c'
                }
            }, {
                name: '易拍',
                value: 1,
                itemStyle: {
                    color: '#03a653'
                }
            }, {
                name: '小青猪',
                value: 1,
                itemStyle: {
                    color: '#038549'
                }
            }]
        }]
    }, {
        name: '资质',
        itemStyle: {
            color: '#0aa3b5'
        },
        children: [{
            name: '资质',
            itemStyle: {
                color: '#76c0cb'
            },
            children: [{
                name: '一级资质',
                value: 1,
                itemStyle: {
                    color: '#80a89d'
                }
            }, {
                name: '二级资质',
                value: 1,
                itemStyle: {
                    color: '#def2fd'
                }
            }, {
                name: '三级资质',
                value: 1,
                itemStyle: {
                    color: '#7a9bae'
                }
            }, {
                name: '四级资质',
                value: 1,
                itemStyle: {
                    color: '#039fb8'
                }
            }]
        }]
    }, {
        name: '住建',
        itemStyle: {
            color: '#c94930'
        },
        children: [{
            name: '进冀企业',
            value: 1,
            itemStyle: {
                color: '#caa465'
            }
        }, {
            name: '其他',
            value: 1,
            itemStyle: {
                color: '#dfbd7e'
            }
        }, {
            name: '竣工验收',
            itemStyle: {
                color: '#be8663'
            },
            children: [{
                name: '34030614030701J02',
                value: 1,
                itemStyle: {
                    color: '#b9a449'
                }
            }, {
                name: '2837844858857378',
                value: 1,
                itemStyle: {
                    color: '#899893'
                }
            }, {
                name: '28348488577338920',
                value: 1,
                itemStyle: {
                    color: '#a1743b'
                }
            }, {
                name: '283884477747477448',
                value: 1,
                itemStyle: {
                    color: '#894810'
                }
            }]
        }, {
            name: '建筑施工许可',
            itemStyle: {
                color: '#ddaf61'
            },
            children: [{
                name: '34010011608100101-SX-001',
                value: 1,
                itemStyle: {
                    color: '#b7906f'
                }
            }, {
                name: '3303022013103004201',
                value: 1,
                itemStyle: {
                    color: '#eb9d5f'
                }
            }]
        }]
    }, {
        name: '信用',
        itemStyle: {
            color: '#ad213e'
        },
        children: [{
            name: '守信红名单',
            value: 1,
            itemStyle: {
                color: '#794752'
            }
        }, {
            name: '纳税人信息',
            value: 1,
            itemStyle: {
                color: '#cc3d41'
            }
        }, {
            name: '其他',
            itemStyle: {
                color: '#b14d57'
            },
            children: [{
                name: '拒不履行判决义务，执行通知书，报告财产制度',
                value: 1,
                itemStyle: {
                    color: '#c78936'
                }
            }, {
                name: '以私设暗管的方式排放水污染物',
                value: 1,
                itemStyle: {
                    color: '#8c292c'
                }
            }, {
                name: '未按照规定期限办理纳税申报和报送纳税资料',
                value: 1,
                itemStyle: {
                    color: '#e5762e'
                }
            }, {
                name: '排放水污染物超过国家规定的水污染物排放标准',
                value: 1,
                itemStyle: {
                    color: '#a16c5a'
                }
            }]
        }]
    }, {
        name: '土地',
        itemStyle: {
            color: '#a87b64'
        },
        children: [{
            name: '土地出让',
            itemStyle: {
                color: '#c78869'
            },
            children: [{
                name: '**界内，3.5，工业用地，挂牌出让',
                value: 1,
                itemStyle: {
                    color: '#d4ad12'
                }
            }, {
                name: '**界内，1.8，其他商服用地，挂牌出让',
                value: 1,
                itemStyle: {
                    color: '#9d5433'
                }
            }, {
                name: '**界内，4.8，其他普通商品住房用地，挂牌出让',
                value: 1,
                itemStyle: {
                    color: '#c89f83'
                }
            }]
        }, {
            name: '土地转让',
            itemStyle: {
                color: '#bb764c'
            },
            children: [{
                name: '**界内，0,。001，其他普通商品住房用地，张三，李四',
                value: 1,
                itemStyle: {
                    color: '#692a19'
                }
            }, {
                name: '**界内，0,。001，其他普通商品住房用地，王五，马六',
                value: 1,
                itemStyle: {
                    color: '#470604'
                }
            }]
        }]
    }, {
        name: '其他',
        itemStyle: {
            color: '#e65832'
        },
        children: [{
            name: '法院',
            itemStyle: {
                color: '#d45a59'
            },
            children: [{
                name: '（2019）冀**民初**号**诉**房屋买卖合同一案起诉',
                value: 1,
                itemStyle: {
                    color: '#310d0f'
                }
            }, {
                name: '（2019）冀**执**号**申请**劳动争议一案执行文书',
                value: 1,
                itemStyle: {
                    color: '#ae341f'
                }
            }, {
                name: '（2019）冀**民初**号**纠纷一案起诉状副本及开庭传票',
                value: 1,
                itemStyle: {
                    color: '#d78823'
                }
            }]
        }, {
            name: '交管',
            value: 1,
            itemStyle: {
                color: '#f89a80'
            }
        }, {
            name: '采购',
            value: 1,
            itemStyle: {
                color: '#f37674'
            }
        }, {
            name: '招投标',
            value: 1,
            itemStyle: {
                color: '#e75b68'
            }
        }, {
            name: '招聘',
            value: 1,
            itemStyle: {
                color: '#d0545f'
            }
        }]
    }];
    $('#qy_sunburst').html("");
    var myChart = echarts.init(document.getElementById('qy_sunburst'), echartsTheme);
    var option = {
        title: {
            text: 'WORLD COFFEE RESEARCH SENSORY LEXICON',
            // subtext: 'Source: https://worldcoffeeresearch.org/work/sensory-lexicon/',
            textStyle: {
                fontSize: 14,
                align: 'center'
            },
            subtextStyle: {
                align: 'center'
            },
            // sublink: 'https://worldcoffeeresearch.org/work/sensory-lexicon/'
        }, title: {
            // text: 'WORLD COFFEE RESEARCH SENSORY LEXICON',
            // subtext: 'Source: https://worldcoffeeresearch.org/work/sensory-lexicon/',
            textStyle: {
                fontSize: 14,
                align: 'center'
            },
            subtextStyle: {
                align: 'center'
            },
            // sublink: 'https://worldcoffeeresearch.org/work/sensory-lexicon/'
        },
        series: {
            type: 'sunburst',
            highlightPolicy: 'ancestor',
            data: [],
            radius: [0, '60%'],
            sort: null,
            levels: [{}, {
                r0: '15%',
                r: '35%',
                itemStyle: {
                    borderWidth: 2
                },
                label: {
                    rotate: 'tangential'
                }
            }, {
                r0: '35%',
                r: '70%',
                label: {
                    align: 'right'
                }
            }, {
                r0: '70%',
                r: '72%',
                label: {
                    position: 'outside',
                    padding: 3,
                    silent: false
                },
                itemStyle: {
                    borderWidth: 3
                }
            }]
        }
    };
    myChart.setOption(option);

    var lay = layer.load({shade: [0.1]});
    $.ajax({
        url: ctx + "/mge/adx/syfx/zhfx/getSunburstEcharts",
        data: {},
        dataType: "json",
        type: 'post',
        success: function (d, s) {
            layer.close(lay);
            if (d.code == '200') {
                var datas = d.data;
                //隐藏loading动画
                myChart.hideLoading();
                myChart.setOption({
                    series: [{
                        data: datas
                    }]
                });

            } else {
                layer.alert(d.message);
            }
        }, error: function (sta) {
            layer.close(lay);
            layer.alert("请求失败，请重试或检查网络！");
        }
    });
}
function ybtOption(data, title) {
    var colorTemplate1 = [[1, '#00a2e8']];
    var option = {
        tooltip: {
            formatter: "{a} <br/>{b} : {c}%"
        },
        toolbox: {
            show: false,
            feature: {
                restore: {},
                saveAsImage: {}
            }
        },
        title: {
            text: ''
        },
        series: [
            {
                name: '业务指标',
                type: 'gauge',
                radius: "60%",
                startAngle: 210,
                endAngle: -30,
                detail: {formatter: '{value}%'},
                data: [{value: data, name: title}],
                min: 0,
                max: 100,
                pointer: {
                    show: false
                },
                axisLine: {				// 仪表盘轴线(轮廓线)相关配置。
                    show: true,				// 是否显示仪表盘轴线(轮廓线),默认 true。
                    lineStyle: {			// 仪表盘轴线样式。
                        color: colorTemplate1, 	//仪表盘的轴线可以被分成不同颜色的多段。每段的  结束位置(范围是[0,1]) 和  颜色  可以通过一个数组来表示。默认取值：[[0.2, '#91c7ae'], [0.8, '#63869e'], [1, '#c23531']]
                        // opacity: 1,					//图形透明度。支持从 0 到 1 的数字，为 0 时不绘制该图形。
                        width: 12				//轴线宽度,默认 30。
                        // shadowBlur: 20,				//(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                        // shadowColor: "#fff",		//阴影颜色。支持的格式同color。
                    }
                },
                splitLine: {			// 分隔线样式。
                    show: false,				// 是否显示分隔线,默认 true。
                    length: 30,				// 分隔线线长。支持相对半径的百分比,默认 30。
                    lineStyle: {			// 分隔线样式。
                        color: "#eee",				//线的颜色,默认 #eee。
                        opacity: 1,					//图形透明度。支持从 0 到 1 的数字，为 0 时不绘制该图形。
                        width: 2,					//线度,默认 2。
                        type: "solid",				//线的类型,默认 solid。 此外还有 dashed,dotted
                        shadowBlur: 10,				//(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                        shadowColor: "#fff"		//阴影颜色。支持的格式同color。
                    }
                },
                axisTick: {				// 刻度(线)样式。
                    show: false,				// 是否显示刻度(线),默认 true。
                    splitNumber: 5,			// 分隔线之间分割的刻度数,默认 5。
                    length: 8,				// 刻度线长。支持相对半径的百分比,默认 8。
                    lineStyle: {			// 刻度线样式。
                        color: "#eee",				//线的颜色,默认 #eee。
                        opacity: 1,					//图形透明度。支持从 0 到 1 的数字，为 0 时不绘制该图形。
                        width: 1,					//线度,默认 1。
                        type: "solid",				//线的类型,默认 solid。 此外还有 dashed,dotted
                        shadowBlur: 10,				//(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
                        shadowColor: "#fff"		//阴影颜色。支持的格式同color。
                    },
                },

                axisLabel: {			// 刻度标签。
                    show: false,				// 是否显示标签,默认 true。
                    distance: 5,			// 标签与刻度线的距离,默认 5。
                    color: "#fff",			// 文字的颜色,默认 #fff。
                    fontSize: 8,			// 文字的字体大小,默认 5。
                    formatter: "{value}"	// 刻度标签的内容格式器，支持字符串模板和回调函数两种形式。 示例:// 使用字符串模板，模板变量为刻度默认标签 {value},如:formatter: '{value} kg'; // 使用函数模板，函数参数分别为刻度数值,如formatter: function (value) {return value + 'km/h';}
                },
                title: {				// 仪表盘标题。
                    show: true,				// 是否显示标题,默认 true。
                    offsetCenter: [0, "45%"],//相对于仪表盘中心的偏移位置，数组第一项是水平方向的偏移，第二项是垂直方向的偏移。可以是绝对的数值，也可以是相对于仪表盘半径的百分比。
                    color: "#000",			// 文字的颜色,默认 #333。
                    fontSize: 12			// 文字的字体大小,默认 15。
                },

                detail: {				// 仪表盘详情，用于显示数据。
                    show: true,				// 是否显示详情,默认 true。
                    offsetCenter: [0, 0],// 相对于仪表盘中心的偏移位置，数组第一项是水平方向的偏移，第二项是垂直方向的偏移。可以是绝对的数值，也可以是相对于仪表盘半径的百分比。
                    color: "auto",			// 文字的颜色,默认 auto。
                    fontSize: 25,			// 文字的字体大小,默认 15。
                    formatter: "{value}%"	// 格式化函数或者字符串
                }
            }
        ]
    }
    return option;
}
function zycszbOption(bq, tq) {
    var option = {
        title: {},
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: ['本期', '同期']
        },
        toolbox: {
            show: false,
            feature: {
                dataView: {show: true, readOnly: false},
                magicType: {show: true, type: ['line', 'bar']},
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        calculable: true,
        grid: {
            bottom: 80
        },
        xAxis: {
            type: 'category',
            data: ['注册资金', '本年累计销售收入', '本年累计利润额', '本年累计纳税金额', '累计欠税金额', '本年累计减免金额'],
            axisLabel: {
                interval: 0,
                rotate: 40,
                formatter: function (v) {
                    var k = [];
                    if (v.length > 5) {
                        k.push(v.substring(0, 5));
                        k.push(v.substring(5));
                        return k.join("\n");
                    } else {
                        return v;
                    }
                }
            }
        }
        ,
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '本期',
                type: 'bar',
                data: bq

            },
            {
                name: '同期',
                type: 'bar',
                data: tq
            }
        ]
    };
    return option;
}
function srgcOption(data) {
    var option = {
        title: {
            x: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: "{b} : {c} ({d}%)"
        },
        series: [
            {
                type: 'pie',
                radius: '55%',
                center: ['40%', '50%'],
                data: [
                    {value: data.yysr, name: '营业收入'},
                    {value: data.yywsr, name: '营业外收入'},
                    {value: data.tzlr, name: '投资利益'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    return option;
}
function lineOption(yfsj, xssr, zzsje, kpje) {
    var option = {
        title: {},
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: ['销售收入', '增值税金额', "开票金额"]
        },
        toolbox: {
            show: false
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: yfsj
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value}'
            }
        },
        series: [
            {
                name: '销售收入',
                type: 'line',
                data: xssr,
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            },
            {
                name: '增值税金额',
                type: 'line',
                data: zzsje,
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            }, {
                name: '开票金额',
                type: 'line',
                data: kpje,
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            }
        ]
    };
    return option;
}
function jcsrOption(data) {
    var option = {
        title: {
            x: 'center'
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['查补税款', '查补滞纳金', '查补罚款']
        },
        tooltip: {
            trigger: 'item',
            formatter: "{b} : {c} ({d}%)"
        },
        series: [
            {
                type: 'pie',
                radius: '55%',
                center: ['40%', '50%'],
                data: [
                    {value: data.cbsk, name: '查补税款'},
                    {value: data.cbznj, name: '查补滞纳金'},
                    {value: data.cbfk, name: '查补罚款'}
                ],
                label: {
                    normal: {
                        show: true,
                        position: 'outSide',
                        formatter: "{b}, {d}%"
                    }
                },
                labelLine: {
                    normal: {
                        show: true
                    }
                },
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    return option;
}
function fptjOption(data) {
    var option = {
        title: {
            x: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: "{b} : {c} ({d}%)"
        },
        series: [
            {
                type: 'pie',
                radius: '55%',
                center: ['40%', '50%'],
                data: data,
                label: {
                    normal: {
                        show: true,
                        position: 'outSide',
                        formatter: "{b}, {d}%"
                    }
                },
                labelLine: {
                    normal: {
                        show: true
                    }
                },
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    return option;
}
function kpzyzbOption(qyzb, hyzb) {
    var option = {
        title: {},
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: ['企业指标', '行业均值']
        },
        toolbox: {
            show: false
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ["未开具发票", "夜间开票", "顶额开票", "作废发票"]
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value}'
            }
        },
        series: [
            {
                name: '企业指标',
                type: 'bar',
                data: qyzb,
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            },
            {
                name: '行业均值',
                type: 'bar',
                data: hyzb,
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            }
        ]
    };
    return option;
}
function xshjxOption(xas, hwd) {
    var option = {
        title: {},
        tooltip: {
            trigger: 'axis'
        },
        toolbox: {
            show: false
        },
        xAxis: {
            type: 'category',
            data: xas,
            axisLabel: {
                interval: 0,
                rotate: 40,
                formatter: function (v) {
                    var k = [];
                    if (v.length > 7) {
                        k.push(v.substring(0, 7));
                        k.push(v.substring(7));
                        return k.join("\n");
                    } else {
                        return v;
                    }
                }
            }
        },
        dataZoom: [
            {
                show: true,
                start: 94,
                end: 100
            },
            {
                type: 'inside',
                start: 94,
                end: 100
            }
        ],
        grid: {
            top: '12%',
            left: '1%',
            right: '10%',
            containLabel: true
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                formatter: '{value}'
            }
        },
        series: [
            {
                name: '货物',
                type: 'bar',
                barWidth: "30%",
                data: hwd
            }
        ]
    };
    return option;
}
function xhghfxOption(data) {
    var option = {
        title: {
            x: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: "{b} : {c} ({d}%)"
        },
        series: [
            {
                type: 'pie',
                radius: '55%',
                center: ['40%', '50%'],
                data: data,
                label: {
                    normal: {
                        show: true,
                        position: 'outSide',
                        formatter: "{b}, {d}%"
                    }
                },
                labelLine: {
                    normal: {
                        show: true
                    }
                },
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    return option;
}